<template>
	<view>
		<button class="cu-btn line-orange" @click="handleUpload">
			通过Nodejs上传图片
		</button>
	</view>
</template>

<script setup lang="ts">
const handleUpload = ()=>{
	uni.chooseImage({
		success: (file) => {
			let temp = file.tempFilePaths[0]
			console.log(file);
			uni.uploadFile({
				url:'http://localhost:3000/upload',
				filePath:temp,
				name:'avatar',
				// header:{
				// 	'content-type':'multipart/form-data'
				// },
				success: (res) => {
					console.log(res);
				}
			})
		}
	})
}
</script>

<style lang="scss">
	       
</style>
